<style>
	@import "../../../common/css/adminHome.css";
</style>
<template>
	<view>
		<view class="admin_common_page">
			<view class="top_fix">
				<view class="search_info">
					<!-- <image class="search_icon" src="../../../static/search.png" mode="aspectFill"></image> -->
					<!-- <input class="search_input" type="text" placeholder="搜索" /> -->
					
				</view>
				<!-- <uni-section :title="'采购日期选择：' + single" type="line"></uni-section> -->
				<view class="" >
					<view class="" style="color: #FBFBFB;">
						<text>选择采购截止日期:</text>
						
					</view>
					
			 <view class="example-body">
			            <uni-datetime-picker type="date" :value="single"  @change="change" />
			        </view>						
				</view>
				
				
				<!-- <view class="business_list">
					<view class="business_list_title">
						<view class="business_list_title_name" v-for="(item, index) in list">{{item.goodsName}}  数量：{{item.goodsNumber}}</view>
					</view>
					
				
				</view> -->
				<uni-table border stripe emptyText="暂无更多数据" type="selection">
				    <!-- 表头行 -->
				    <uni-tr>
				        <uni-th align="center">商品名称</uni-th>
				        <uni-th align="center">商品数量</uni-th>
				       
				    </uni-tr>
				    <!-- 表格数据行 -->
				    <uni-tr v-for="(item, index) in list">
				        <uni-td>{{item.goodsName}}</uni-td>
				        <uni-td>{{item.goodsNumber}}</uni-td>
				       
				    </uni-tr>
				   
				
				</uni-table>
				<button type="primary" @click="tijiao" >本次配货确认</button>
			</view>
			<view class="order-content" @touchmove.stop.prevent>
				<view class="tabs-swiper-content">
					<u-tabs-swiper ref="uTabs" :list="dataList" :current="current" @change="tabsChange"
						:is-scroll="false" swiperWidth="750" :bgColor="tabColor" :inactiveColor="inactiveColor"
						:activeColor="activeColor">
					</u-tabs-swiper>
				</view>
				<!-- <swiper class="swipers" :style="{height:listSwiperHeight + 'rpx'}" :current="swiperCurrent"  @transition="transition" @animationfinish="animationfinish">
					<swiper-item class="swiper-item" v-for="(item, index) in dataList" :key="index">
						<scroll-tab-swiper-item :tabIndex="index" :currentIndex="swiperCurrent" @backOrder="backOrder"></scroll-tab-swiper-item>
					</swiper-item>
				</swiper> -->
				<swiper class="swipers" :style="{height: listSwiperHeight}" :current="swiperCurrent"
					@transition="transition" @animationfinish="animationfinish">
					<swiper-item class="swiper-item" v-for="(item, index) in dataList" :key="index">
						<scroll-tab-swiper-item :tabIndex="index" :currentIndex="swiperCurrent" @backOrder="backOrder">
						</scroll-tab-swiper-item>
					</swiper-item>
				</swiper>
			</view>
			<backOrder v-if="isShowBackOrder" :orderSn="backOrderSn" @cancelBackOrder="cancelBackOrder"
				@submitBackOrder="submitBackOrder"></backOrder>
			<createShop v-if="isShowAddShop" @cancelAddShop="cancelAddShop" @submitAddShop="submitAddShop"></createShop>
			<tabBarAdmin :pagePath="'/pages/admin/home/home'"></tabBarAdmin>
		</view>
		<tabBarAdmin :pagePath="'/pages/admin/caigou/caigou'"></tabBarAdmin>
	</view>
</template>
import cgSwiper from '@/components/cg-swiper/cg-swiper.vue';
import backOrder from '@/components/show-model/show-backOrder/back-order.vue'
import createShop from '@/components/show-model/show-createShop/create-shop.vue'
<script>
	export default {
		data() {
			return {
				list:[],//采购列表
				single: '',
				datetimesingle: '2021-04-3',
				range: ['2021-03-8', '2021-4-20'],
				datetimerange: ['2021-03-20 20:10:10', '2021-05-10 10:10:10'],
			}
		},
		onLoad() {
			
		},
		watch: {
			datetimesingle(newval) {
				console.log('单选:', this.datetimesingle);
			},
		},
		mounted() {
			
			setTimeout(() => {
				let newDate = new Date();
				let years =newDate.getFullYear();
				let Months = newDate.getMonth()+1; 
				let Dates = newDate.getDate();
				console.log(years,Months+1,Dates)
				this.datetimesingle = years+"-" + Months+"-" + Dates
				this.single = years+"-" + Months+"-" + Dates
				// this.datetimesingle = '2021-5-1'
				// this.single = '2021-5-1'
			}, 1000)
		},
		methods: {
		tijiao(){
			console.log("提交")
			let postData = {endTime:this.single}
			console.log(106,postData)
				this.$api.caigou.tijiao(postData)
				.then(res => {
					if(res.code == 200){
						// this.scsList = res.data
						console.log(res.data)
						this.list = res.data
						
					}else{
						this.$commonJs.showToast.showNoneToast(res.err)
					}
				})
				.catch(err => {
					this.$commonJs.showToast.showNoneToast(err)
				})
		},
		change(e) {
			this.single = e
			console.log('----change事件:', this.single = e);
			let postData = {endTime:this.single}
			console.log(106,postData)
				this.$api.caigou.caigous(postData)
				.then(res => {
					if(res.code == 200){
						// this.scsList = res.data
						console.log(res.data)
						this.list = res.data
						
					}else{
						this.$commonJs.showToast.showNoneToast(res.err)
					}
				})
				.catch(err => {
					this.$commonJs.showToast.showNoneToast(err)
				})
		},
		changeLog(e) {
			console.log('----change事件:', e);
		},
		maskClick(e){
			console.log('----maskClick事件:', e);
		}
			
			
		}
	}
</script>

<style lang="scss">
 @import '@/common/uni-nvue.scss';
</style>
